<template name="project">
  <div id="project">
    <div class="container">
      <h1>{{title}}</h1>
      <p class="lead text-muted">created by {{owner}} on {{formatDate date_created "long"}}</p>
    {{description}}<br/>
    </div>
    <hr/>
    <div class="container">
      <div class="row">
        <div class="col-md-5">
          <div class="col-md-12">
          {{> projectmap this}}
          </div>
          <div class="col-md-12">
            <span class="label label-warning">Primary Tag</span>
            <button type="button" class="btn btn-default btn-xs primary-tag" data-toggle="tooltip" title="Main Classification. Visit /tags for more information on this tag.">{{maintag}}</button>
          </div>
          <hr />
          <div class="col-md-12">
            {{> projectTags this }}
          </div>
        </div>
      <hr/>
      <div class="col-md-7">
        <form role="form" class="form-addcomment">
        	<input id="project-comment" type="text" autofocus="" required placeholder="Enter your comment" class="form-control input-lg input-block"/><br/>
         	<button type="submit" class="btn btn-default btn-lg btn-block">submit</button>
        </form><br/>
        {{#each comments}}
            <div class="well well-sm comment">
                <div class="row">
                    <div class="col-md-2"><img src="{{avatarUrl}}" class="img-circle" alt="Avatar"/></div>
               	    <div class="col-md-10 comment-data">
               	    <span class="comment-author"><h3>{{author}}<br/><small> posted {{posted_timeago}}</small></h3></span>
               	    <span class="comment-body">{{body}}</span>
               	    </div>
               	</div>
     	    </div>
     	{{/each}}
      </div>
      </div> <!-- /row-->
    </div> <!-- /container -->
  </div><!-- /project -->
</template>

<template name="projectTags">
  <div class="project-tags">
  <span class="label label-info">More Tags</span>
    {{#each tags}}
      {{#if tagSelected}}
        <button type="button" class="btn btn-default btn-xs tag-name btn-success" data-tier="{{tier}}" data-toggle="tooltip" title="{{excerpt}}">{{name}}</button>
      {{else}}
        <button type="button" class="btn btn-default btn-xs tag-name" data-tier="{{tier}}" data-toggle="tooltip" title="{{excerpt}}">{{name}}</button>
      {{/if}}
    {{/each}}
  </div> <!-- button group -->
</template>